#include <iostream>
#include <cstring>
#include <queue>
#include <map>
#include <vector>
#include <string.h>
using namespace std;

int k, n;
int interest = 0;

int main()
{
    cin >> k >> n;
    for (int i = 1; i <= n; i++)
    {
        interest = k >= 50 ? 5 : k / 10;
        k += 5 + interest;
    }
    cout << k << endl;
   // system("pause");
    return 0;
}